package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: liangyuanzhang
 * Date: 2025-1-14
 * Time: 19:47
 */
public class Dog extends Animal{

    public Dog(String name, int age) {
        super(name, age);
    }

    public void bark(){
        System.out.println(this.name + " 正在汪汪叫......");
    }

    @Override//注解：当前这个方法被重写
    public void eat(){//子类的eat()方法和父类的eat()方法发生了重写
        System.out.println(this.name + " 正在吃狗粮......");
    }
}
